package com.neiquan.backstage.platform_system_config.impl;

import org.hibernate.criterion.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neiquan.backstage.common.util.ExtraSpringHibernateTemplate;
import com.neiquan.backstage.common.util.Paging;
import com.neiquan.backstage.platform_system_config.PlatformSystemConfigService;
import com.neiquan.backstage.pub.bsc.dao.po.PlatformSystemConfig;

@Service
public class PlatformSystemConfigServiceImpl implements PlatformSystemConfigService {
	private static Class<?> poc = PlatformSystemConfig.class;
	@Autowired
	private ExtraSpringHibernateTemplate extraSpringHibernateTemplate;


	@Override
	public PlatformSystemConfig query() {
		Paging<PlatformSystemConfig> paging = extraSpringHibernateTemplate.findPage(poc, Order.desc("configId"), 0, 1);
		return paging.getCount() > 0? paging.getList().get(0):null;
	}
}
